package com.trans.dao;

import com.trans.domain.Account;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface AccountDao {

    //转入
    @Update("update t_account set money = money + ${money} where name = #{name}")
    void addMoney(@Param("name") String name, @Param("money") Double money);

    //转出
    @Update("update t_account set money = money - ${money} where name = #{name}")
    void minusMoney(@Param("name") String name, @Param("money") Double money);


    @Select("select * from t_account")
    List<Account> findAll();

}
